package oop.java0318;

import java.util.Scanner;

public class TouristTest {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (true) {
            Tourist t = new Tourist();
            System.out.print("请输入姓名：");
            t.name = in.next();
            if (t.name.equals("n")) {
                System.out.println("退出程序！");
                break;
            }
            System.out.print("请输入年龄：");
            t.age = in.nextInt();
            int money = t.CalPrice();
            System.out.println("票价：" + money);
        }
    }
}
